﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BackMaster2.Master" AutoEventWireup="true" CodeBehind="RechargeRecordShow.aspx.cs" Inherits="BackStage.RechargeRecordShow" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <script src="/BootstrapSouce/js/jquery.min.js"></script>
   <%--   <script src="/BootstrapSouce/js/bootstrap.min.js"></script>
    <link href="/BootstrapSouce/css/bootstrap.min.css" rel="stylesheet" />--%>
    <script src="BootstrapSouce/js/Command.js"></script>
    <script>
        var counttt = 0;
        //首次加载
        $(function ()
        {
            Page(1)
        })
        //分页
        function Page(i) {
            $("#Search").hide()
            $.getJSON("/Hand/RechargeRecord.ashx", {
                index: i, Size: $("#num").val(), MinMoney: $("#MinMoney").val(), MaxMoney: $("#MaxMoney").val()
                , MaxTime: $("#MaxTime").val(), MinTime: $("#MinTime").val()
            }, function (mes) {

                var str = "<tr><td>充值金额</td><td>充值方式</td><td>充值时间</td><td>充值人</td><td>操作</td></tr>";
                for (var i = 0; i < mes.Data.length; i++) {
                    str += "<tr><td id='RechargeMoney'>" + mes.Data[i].RechargeMoney + "</td><td id='RechargeMode'>" + mes.Data[i].RechargeMode + "</td><td id='RechargeTime'>" + ChangeDateFormat(mes.Data[i].RechargeTime) + "</td><td id='UserName'>" + mes.Data[i].UserName + "</td><td><a href='#' id='" + mes.Data[i].RechargeRecordId + "' data-toggle='modal' data-target='#myModal'  onclick='upd(" + mes.Data[i].RechargeRecordId + ")'>详情</a></td></tr>";
                }
                counttt = mes.PageCount;
                var pager = "";
                pager += "<li style='float:right'><a> 当前第 " + mes.PageIndex + " 页</a><a> 共" + mes.PageCount + "页  </a><a>转到<input type='number' id='pageas' />页<input type='button' class='ben btn-primary' onclick='tiaozhuan()'  min='1'  value='确定'></a></li>";
                pager += "<li> <a href='#' onclick='Page(1)'>首页</a></li>";
                //判断当前页是否为1，如果不是那就减一如果是那就直接定到第一页
                if (mes.PageIndex <= 1) {
                    pager += ("<li><a href='#'  onclick='Page(1)'  >上一页</a></li>");
                }
                else {
                    pager += ("<li><a href='#'  onclick='Page(" + (mes.PageIndex - 1) + ")'  >上一页</a></li>");
                }
                //判断是否为最后一页。如果不是那就加一如果是那就直接定到最后一页
                if (mes.PageIndex >= mes.PageCount) {
                    pager += "<li><a  href='#' onclick='Page(" + (mes.PageCount) + ")' >下一页</a></li>";
                } else {
                    pager += "<li><a  href='#' onclick='Page(" + (mes.PageIndex + 1) + ")' >下一页</a></li>";
                }
                pager += " <li><a  href='#' onclick='Page(" + mes.PageCount + ")'>尾页</a></li>";
                pager += "<li style='float:left'><a href='#' onclick='Search()'  >筛选</a><li>";
                $("#Tbody").html(str);
                $("#pager").html(pager);
            });
        }
        //跳转到搜索页面
        function tiaozhuan() {
            if ($("#pageas").val() > counttt) {
                alert("超出最大页数")
            }
            else {
                Page($("#pageas").val())
            }
        }
        function Search() {
            if ($("#hidd").val() != "") {
                $("#Search").hide()
                $("#hidd").val("")
            }
            else {
                $("#Search").show()
                $("#hidd").val("s")
            }
        }
        //修改获取值
    </script>
   <div>
       <div class="clearfix">

       </div>
       <div style="width:100%;" toggle="hide" id="Search">
           <input type="hidden" id="hidd" value="" />
           <table style="text-align:left">
               <tr>
                   <td>充值最小金额</td>
                   <td><input type="number" min="1" id="MinMoney" value="0"  /></td>
                   <td>充值最大金额</td>
                   <td><input type="number" min="1"  id="MaxMoney" value="0"  /></td>
               </tr>
               <tr>
                   <td>起始时间</td>
                   <td><input type="date" id="MinTime" value="" /></td>
                   <td>结束时间</td>
                   <td><input type="date" id="MaxTime" value="" /></td>
               </tr>
               <tr>
                   <td>每页显示数量</td>
                   <td><input type="number" id="num" value="5" /></td>
                   <td colspan="2"><input type="button" name="name" onclick="Page(1)" value="查询"  class="btn btn-primary"/></td>

               </tr>
           </table>
       </div>
       <br />
            <table id="Tbody" class="table table-hover" style="text-align:center" >
            </table>
       <ul class="pager" id="pager">

       </ul>
   </div>
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            &times;
                        </button>
                        <h4 class="modal-title" id="myModalLabel"></h4>
                    </div>
                    <div id="xiangqing_huiyuan" class="modal-body">
                        <ul id="myTab" class="nav nav-tabs">
                            <li class="active">
                                <a href="#" data-toggle="tab">
                                    查看详情
                                </a>
                            </li>
                        </ul>
                        <div id="myTabContent2" class="tab-content">
                            <div class="tab-pane fade in active" id="home">
                                <table class="table">
                                <tr>
                                    <td>
                                        充值金额
                                    </td>
                                     <td>
                                         <input type="text" id="URechargeMoney" value="" />
                                         <input type="hidden" id="Rid" value="" />
                                    </td>
                                </tr>    
                                <tr>     
                                    <td> 
                                        充值方式
                                    </td>
                                     <td>
                                         <select id="URechargeMode">
                                             <option value="线上">线上</option>
                                             <option value="线下">线下</option>
                                         </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        充值时间
                                    </td>
                                     <td>
                                         <input type="Date" id="URechargeTime" value="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        充值人
                                    </td>
                                     <td>
                                         <input type="text" id="UUserName" value=" " />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="button" name="name" value="提交" onclick="UpdRechargeRecord()" class="btn btn-primary" />
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal" id="btn-close">
                            关闭
                        </button>
                    </div>
                </div>
            </div>
        </div>

</asp:Content>


 